html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
}

.header, .footer {
    width: 100%;
    height: 80px; 
    position: absolute;
    left: 0;
    line-height: 80px;
    text-align: center;
    font-size: 18px;
    color: #fff;
}

.header {
    background-color: skyblue;
    top: 0;
}

.footer {
    background-color: purple;
    bottom: 0;
}

.main {
    width: 100%;
    position: absolute;
    top: 80px;
    bottom: 80px;
    padding: 20px 0;
    text-align: center;
    background: khaki;
}